<?php

use think\migration\Migrator;
use think\migration\db\Column;

class SourceBureauAirQualityWeatherForecast extends Migrator
{
    public function up()
    {
        $table = $this->table('source_bureau_air_quality_weather_forecast');
        $table
            //step1:城市
            ->addColumn('city_name', 'string', ['limit' => 50, 'default' => '', 'comment' => '城市名称'])

            ->addColumn('data', 'text', ['comment' => '天气预报预测数据'])

            //step2:时间
            ->addColumn('predict_time', 'datetime', ['comment' => '预报时间'])
            ->addColumn('publish_time', 'datetime', ['comment' => '发布时间'])
            ->addColumn('create_time', 'datetime', [ 'comment' => '入库时间'])

            //step3:状态
            ->addColumn('is_to_tsinghua', 'integer', ['limit' => 2, 'default' => '0', 'comment' => '是否推送给清华0未推送1推送'])
            //注释
            ->setComment('(弃用) 初始数据来源 - 气象局 - 空气质量 - 天气预报（小时）')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }

    public function down()
    {
        $this->table('source_bureau_air_quality_weather_forecast')->drop();
    }
}
